<?php
class C_s_perusahaan extends Nvl_Controller{
	
	function __construct(){
		parent::__construct();
		session_start();
		if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
			if(!isset($_SESSION[SESSION_USERID])){
				$this->output->set_status_header('301');
			}
		}else{
			if(!isset($_SESSION[SESSION_USERID])){
				$this->session->set_flashdata(EXPIRED_SESSION);
				redirect('c_login');
			}
		}
		$this->load->model('m_s_perusahaan');
	}
	
	function index(){
		$data['data_perusahaan']=$this->m_s_perusahaan->get_setting();
		$this->load->view('pages/v_s_perusahaan', $data);
	}
	
	function save(){
		$params = json_decode($this->input->post('params'));
		$result = $this->m_s_perusahaan->__save($params->form_data, 1);
		echo $result;
	}
	
}